﻿@model CustomerReportsModel
@{
    //page title
    ViewBag.Title = T("Admin.Customers.Reports").Text;
}
@using Telerik.Web.Mvc.UI
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Areas/Admin/content/images/ico-customers.png")" alt="" />
        @T("Admin.Customers.Reports")
    </div>
    <div class="options">
    </div>
</div>
@Html.Telerik().TabStrip().Name("customer-reports").Items(x =>
{
    x.Add().Text(T("Admin.Customers.Reports.BestBy.BestByOrderTotal").Text).Content(TabBestByOrderTotal().ToHtmlString()).Selected(true);
    x.Add().Text(T("Admin.Customers.Reports.BestBy.BestByNumberOfOrders").Text).Content(TabBestByNumberOfOrders().ToHtmlString());
    x.Add().Text(T("Admin.Customers.Reports.RegisteredCustomers").Text).Content(TabRegisteredCustomers().ToHtmlString());

    //generate an event
    EngineContext.Current.Resolve<IEventPublisher>().Publish(new AdminTabStripCreated(x, "customer-reports"));
})
@helper TabBestByOrderTotal()
    {
        var dataDictAttributes = new ViewDataDictionary();
        dataDictAttributes.TemplateInfo.HtmlFieldPrefix = "bestbyordertotal";
    @Html.Partial("_ReportBestCustomersByOrderTotal", Model.BestCustomersByOrderTotal, dataDictAttributes)
}
@helper TabBestByNumberOfOrders()
    {
        var dataDictAttributes = new ViewDataDictionary();
        dataDictAttributes.TemplateInfo.HtmlFieldPrefix = "bestbynumberoforders";
    @Html.Partial("_ReportBestCustomersByNumberOfOrders", Model.BestCustomersByOrderTotal, dataDictAttributes)
}
@helper TabRegisteredCustomers()
    {
    @Html.Action("ReportRegisteredCustomers")
}